<include file="Common:header" />
<body>
    <!--面包屑导航 开始-->
    <div class="crumb_warp">
        <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
        <i class="fa fa-home"></i> <a href="{:U(MODULE_NAME.'/Index/info')}">首页</a> &raquo; 添加用户
    </div>
    <!--面包屑导航 结束-->

	<!--结果集标题与导航组件 开始-->
	<div class="result_wrap">
        <div class="result_title">
            <h3>添加用户</h3>
            <notempty name='Think.get.msg'>
                <div class="mark">
                    <p>{$Think.get.msg}</p>
                </div>
            </notempty>
        </div>
    </div>

    <!--结果集标题与导航组件 结束-->

    <div class="result_wrap">
        <form action="{:U(MODULE_NAME.'/Access/addUser')}" method="post">
            <table class="add_tab">
                <tbody>
                    <tr>
                        <th><i class="require">*</i>用户名：</th>
                        <td>
                            <input type="text" id="username" name="username">
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require">*</i>密码：</th>
                        <td><input type="password" name="password" id="password" /></td>
                    </tr>
                    <tr>
                        <th>是否开启：</th>
                        <td>
                            <label for=""><input type="radio" name="lock" value="1" checked="checked">开启</label>
                            <label for=""><input type="radio" name="lock" value="0">关闭</label>
                        </td>
                    </tr>
                    <tr>
                        <th>所属角色：</th>
                        <td><foreach name="role" item="r"> <input
                                type="checkbox" name="role_id[]" value="{$r.id}"/>{$r.remark}&nbsp;&nbsp;&nbsp;&nbsp;
                        </foreach></td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input type="submit" id="button" value="提交">
                            <input type="button" class="back" onclick="history.go(-1)" value="返回">
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>

</body>
</html>

<script type="text/javascript">
    $(function() {
        $("#button").click(function() {
            var username = $("#username").val();
            var password = $("#password").val();
            if(username == ''){
                layer.msg('用户名不能为空！');
                $("#username").focus();
                return false;
            }
            if(password == ''){
                layer.msg('密码不能为空！');
                $("#password").focus();
                return false;
            }
        });
    })
</script>